#ifndef  __L_
#define  __L_
#include <func.h>
#define MAXEVENTS 12
#define BUFSIZE 1024
typedef struct channel{
    char sendbuf[BUFSIZE];
    int sendbufsize;
    char recvbuf[BUFSIZE];
    int recvbufsize;
    int fd;
}channel_t;

typedef struct pthread {
	int flag;
	int clientfd;
	char* filename;
	char* order;
	int epfd;
	MYSQL * conn;
	char * username;
	pthread_mutex_t mutex;
	pthread_cond_t cond;
}pthreadpoll_t;

int tcpinit(u_int16_t port,const char* ip);
void epollinit(int epfd,int fd);
void pthreadpollinit(pthreadpoll_t pthreadpoll[]);
void* waitfunc(void* arg);
void dowork(pthreadpoll_t pthreadpoll[],int clientfd,char* filename,char* order,int epfd, MYSQL * conn);
#endif
